package com.ibeetl.admin.aod.service.excel.processor;

import com.ibeetl.admin.aod.entity.AodBlackList;
import com.ibeetl.admin.aod.entity.AodIndustryData;
import com.ibeetl.admin.aod.service.AodBlackListService;
import com.ibeetl.admin.aod.service.AodIndustryDataService;
import com.ibeetl.admin.aod.util.ToolUtil;
import com.ibeetl.admin.aod.web.query.AodIndustryDataQuery;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * 黑名单导入
 */
@Component
@Transactional
public class AodBlackListImportProcessor extends AbstractImportProcessor<AodBlackList> {

    @Autowired
    protected AodBlackListService aodBlackListService;

    @Override
    protected void postProcess(List<AodBlackList> dataList) {
        // 暂时不需要改成多线程,增量上传的黑名单不会太多,第一次的黑名单存量数据 采用其他方式导入库
        for (AodBlackList aodBlackList : dataList) {
            aodBlackListService.saveAndDeleteIndustryData(aodBlackList);
        }

    }
}
